/*
 * Created by SharpDevelop.
 * User: c0148643
 * Date: 24/05/2010
 * Time: 15:31
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;
using System.IO;
using System.Collections;
using Ionic.Zip;

namespace pontoIndividual
{
	/// <summary>
	/// Description of ZipUtil.
	/// </summary>
	public class ZipUtil
	{
		public ZipUtil()
		{
			
		}
		
		public static bool ZiparDiretorio(string dir, string arquivoDestino) {
			
			try {
				using (ZipFile zf = new ZipFile() ) {

					zf.AddDirectory(dir);
					zf.Comment = "Criado pela rotina de Backup Automatico em: " + DateTime.Now;
					zf.Save(arquivoDestino);
				}
			} catch (Exception exc) {
				return false;
			}
			
			return true;
		}
		
	}
}
